# To change this template, choose Tools | Templates
# and open the template in the editor.

__author__="Eagle"
__date__ ="$12.4.2011 22:38:01$"

class Module():
    def __init__(self, model, view, controller):
        self.model = model
        self.view = view
        self.controller = controller

class ModuleManager():
    instance = None
    modules = {}

    def Register(self, name, model, view, controller):
        self.modules[name] = Module(model, view, controller)

    def Get(self, name):
        if name not in self.modules:
            return None
        return self.modules[name]

    @classmethod
    def getInstance(self):
        if self.instance is None:
            self.instance = ModuleManager()

        return self.instance